<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-3.0.xsd">
	<bean id="onlineUserDao"
		class="com.base.security.onlineuser.service.OnlineUserDao">
		<property name="hibernateTemplate">
			<ref bean="hibernateTemplate" />
		</property>
	</bean>
	<bean id="maxOnlineUserDao"
		class="com.base.security.onlineuser.service.MaxOnlineUserDao">
		<property name="hibernateTemplate">
			<ref bean="hibernateTemplate" />
		</property>
	</bean>
	<bean id="userLoginHandler"
		class="com.base.security.onlineuser.service.DefaultUserLoginHandler">
		<property name="onlineUserDao" ref="onlineUserDao" />
		<property name="maxOnlineUserDao" ref="maxOnlineUserDao" />
		<property name="userLogStoreEnable" value="yes"></property>
		<property name="keyUserLogStore" value="yes"></property>
		<property name="loginTimeout" value="1800"></property>
		<property name="loginDuplication" value="no"></property>
	</bean>
	<bean id="checkUserStatusFilter"
		class="com.base.security.onlineuser.filter.CheckUserStatusFilter">
		<property name="userLoginHandler" ref="userLoginHandler" />
	</bean>
	<bean id="loginSuccessHandler"
		class="com.base.security.onlineuser.service.LoginSuccessHandler">
		<property name="userLoginHandler" ref="userLoginHandler" />
	</bean>
	<bean id="simpleLogoutSuccessHandler"
		class="com.base.security.onlineuser.service.SimpleLogoutSuccessHandler">
		<property name="userLoginHandler" ref="userLoginHandler" />
	</bean>
	<!--定时检测 10分钟执行一次-->
	<bean id="onlineUserCheckJobDetail"
		class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
		<property name="targetObject">
			<ref bean="userLoginHandler" />
		</property>
		<property name="targetMethod">
			<value>checkNoActUser</value>
		</property>
		<property name="concurrent">
			<value>false</value>
		</property>
	</bean>
	<bean id="onlineUsercheckTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		<property name="jobDetail">
			<!-- see the example of method invoking job above -->
			<ref bean="onlineUserCheckJobDetail" />
		</property>
		<property name="startDelay">
			<value>2000</value>
		</property>
		<property name="repeatInterval">
			<!--11分钟10*60*1000-->
			<value>660000</value>
		</property>
	</bean>
	<!--定时存储用户访问记录 20分钟-->
	<bean id="onlineUserLogStoreJobDetail"
		class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
		<property name="targetObject">
			<ref bean="userLoginHandler" />
		</property>
		<property name="targetMethod">
			<value>userLoginRecordStore</value>
		</property>
		<property name="concurrent">
			<value>false</value>
		</property>
	</bean>
	<bean id="onlineUserLogStoreTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		<property name="jobDetail">
			<!-- see the example of method invoking job above -->
			<ref bean="onlineUserLogStoreJobDetail" />
		</property>
		<property name="startDelay">
			<value>2000</value>
		</property>
		<property name="repeatInterval">
			<!--23分钟23*60*1000-->
			<value>1380000</value>
		</property>
	</bean>
	<!--定期执行任务的调度器-->
	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="triggers">
			<list>
				<ref bean="onlineUsercheckTrigger" />
				<ref bean="onlineUserLogStoreTrigger" />
			</list>
		</property>
	</bean>
</beans>